<?php
/*************************************************************************

  $Id: osc22ms1.config.php 543 2010-07-15 12:47:10Z dis $

  iclear payment system - because secure is simply secure
  http://www.iclear.de

  Copyright (c) 2001 - 2009 iclear

  Released under the GNU General Public License

************************************************************************

                    All rights reserved.

  This program is free software licensed under the GNU General Public License (GPL).

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  USA

*************************************************************************/

  if(!defined('IC_SEC')) {
    die('No external calls allowed!');
  }

  global $icCore;
  
// following code is only in use if this is an asynchronous call (application_top.php not in use)
  if(!defined('DIR_WS_CATALOG')) {
  	$icSysPath = $icCore->getPath();
    require $icSysPath . 'includes/configure.php';
    
// define the project version
  define('PROJECT_VERSION', 'osCommerce 2.2-MS1');

// set the type of request (secure or not)
  $request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';

// define the filenames used in the project
  define('FILENAME_ACCOUNT', 'account.php');
  define('FILENAME_ACCOUNT_EDIT', 'account_edit.php');
  define('FILENAME_ACCOUNT_EDIT_PROCESS', 'account_edit_process.php');
  define('FILENAME_ACCOUNT_HISTORY', 'account_history.php');
  define('FILENAME_ACCOUNT_HISTORY_INFO', 'account_history_info.php');
  define('FILENAME_ADDRESS_BOOK', 'address_book.php');
  define('FILENAME_ADDRESS_BOOK_PROCESS', 'address_book_process.php');
  define('FILENAME_ADVANCED_SEARCH', 'advanced_search.php');
  define('FILENAME_ADVANCED_SEARCH_RESULT', 'advanced_search_result.php');
  define('FILENAME_ALSO_PURCHASED_PRODUCTS', 'also_purchased_products.php'); // This is the bottom of product_info.php (found in modules)
  define('FILENAME_CHECKOUT_CONFIRMATION', 'checkout_confirmation.php');
  define('FILENAME_CHECKOUT_PAYMENT', 'checkout_payment.php');
  define('FILENAME_CHECKOUT_PAYMENT_ADDRESS', 'checkout_payment_address.php');
  define('FILENAME_CHECKOUT_PROCESS', 'checkout_process.php');
  define('FILENAME_CHECKOUT_SHIPPING', 'checkout_shipping.php');
  define('FILENAME_CHECKOUT_SHIPPING_ADDRESS', 'checkout_shipping_address.php');
  define('FILENAME_CHECKOUT_SUCCESS', 'checkout_success.php');
  define('FILENAME_CONTACT_US', 'contact_us.php');
  define('FILENAME_CONDITIONS', 'conditions.php');
  define('FILENAME_CREATE_ACCOUNT', 'create_account.php');
  define('FILENAME_CREATE_ACCOUNT_PROCESS', 'create_account_process.php');
  define('FILENAME_CREATE_ACCOUNT_SUCCESS', 'create_account_success.php');
  define('FILENAME_DEFAULT', 'default.php');
  define('FILENAME_DOWNLOAD', 'download.php');
  define('FILENAME_INFO_SHOPPING_CART', 'info_shopping_cart.php');
  define('FILENAME_LOGIN', 'login.php');
  define('FILENAME_LOGOFF', 'logoff.php');
  define('FILENAME_NEW_PRODUCTS', 'new_products.php'); // This is the middle of default.php (found in modules)
  define('FILENAME_PASSWORD_FORGOTTEN', 'password_forgotten.php');
  define('FILENAME_POPUP_IMAGE', 'popup_image.php');
  define('FILENAME_POPUP_SEARCH_HELP', 'popup_search_help.php');
  define('FILENAME_PRIVACY', 'privacy.php');
  define('FILENAME_PRODUCT_INFO', 'product_info.php');
  define('FILENAME_PRODUCT_LISTING', 'product_listing.php');
  define('FILENAME_PRODUCT_NOTIFICATIONS', 'product_notifications.php');
  define('FILENAME_PRODUCT_REVIEWS', 'product_reviews.php');
  define('FILENAME_PRODUCT_REVIEWS_INFO', 'product_reviews_info.php');
  define('FILENAME_PRODUCT_REVIEWS_WRITE', 'product_reviews_write.php');
  define('FILENAME_PRODUCTS_NEW', 'products_new.php');
  define('FILENAME_REDIRECT', 'redirect.php');
  define('FILENAME_REVIEWS', 'reviews.php');
  define('FILENAME_SHIPPING', 'shipping.php');
  define('FILENAME_SHOPPING_CART', 'shopping_cart.php');
  define('FILENAME_SPECIALS', 'specials.php');
  define('FILENAME_TELL_A_FRIEND', 'tell_a_friend.php');
  define('FILENAME_UPCOMING_PRODUCTS', 'upcoming_products.php'); // This is the bottom of default.php (found in modules)

// define the database table names used in the project
    define('TABLE_ADDRESS_BOOK', 'address_book');
	  define('TABLE_ADDRESS_FORMAT', 'address_format');
	  define('TABLE_BANNERS', 'banners');
	  define('TABLE_BANNERS_HISTORY', 'banners_history');
	  define('TABLE_CATEGORIES', 'categories');
	  define('TABLE_CATEGORIES_DESCRIPTION', 'categories_description');
	  define('TABLE_CONFIGURATION', 'configuration');
	  define('TABLE_CONFIGURATION_GROUP', 'configuration_group');
	  define('TABLE_COUNTER', 'counter');
	  define('TABLE_COUNTER_HISTORY', 'counter_history');
	  define('TABLE_COUNTRIES', 'countries');
	  define('TABLE_CURRENCIES', 'currencies');
	  define('TABLE_CUSTOMERS', 'customers');
	  define('TABLE_CUSTOMERS_BASKET', 'customers_basket');
	  define('TABLE_CUSTOMERS_BASKET_ATTRIBUTES', 'customers_basket_attributes');
	  define('TABLE_CUSTOMERS_INFO', 'customers_info');
	  define('TABLE_LANGUAGES', 'languages');
	  define('TABLE_MANUFACTURERS', 'manufacturers');
	  define('TABLE_MANUFACTURERS_INFO', 'manufacturers_info');
	  define('TABLE_ORDERS', 'orders');
	  define('TABLE_ORDERS_PRODUCTS', 'orders_products');
	  define('TABLE_ORDERS_PRODUCTS_ATTRIBUTES', 'orders_products_attributes');
	  define('TABLE_ORDERS_PRODUCTS_DOWNLOAD', 'orders_products_download');
	  define('TABLE_ORDERS_STATUS', 'orders_status');
	  define('TABLE_ORDERS_STATUS_HISTORY', 'orders_status_history');
	  define('TABLE_ORDERS_TOTAL', 'orders_total');
	  define('TABLE_PRODUCTS', 'products');
	  define('TABLE_PRODUCTS_ATTRIBUTES', 'products_attributes');
	  define('TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD', 'products_attributes_download');
	  define('TABLE_PRODUCTS_DESCRIPTION', 'products_description');
	  define('TABLE_PRODUCTS_NOTIFICATIONS', 'products_notifications');
	  define('TABLE_PRODUCTS_OPTIONS', 'products_options');
	  define('TABLE_PRODUCTS_OPTIONS_VALUES', 'products_options_values');
	  define('TABLE_PRODUCTS_OPTIONS_VALUES_TO_PRODUCTS_OPTIONS', 'products_options_values_to_products_options');
	  define('TABLE_PRODUCTS_TO_CATEGORIES', 'products_to_categories');
	  define('TABLE_REVIEWS', 'reviews');
	  define('TABLE_REVIEWS_DESCRIPTION', 'reviews_description');
	  define('TABLE_SESSIONS', 'sessions');
	  define('TABLE_SPECIALS', 'specials');
	  define('TABLE_TAX_CLASS', 'tax_class');
	  define('TABLE_TAX_RATES', 'tax_rates');
	  define('TABLE_GEO_ZONES', 'geo_zones');
	  define('TABLE_ZONES_TO_GEO_ZONES', 'zones_to_geo_zones');
	  define('TABLE_WHOS_ONLINE', 'whos_online');
	  define('TABLE_ZONES', 'zones'); 
    
// needed 4 email class!
    define('CHARSET', 'iso-8859-1');
	  
	  if (!isset($PHP_SELF)) $PHP_SELF = $HTTP_SERVER_VARS['PHP_SELF'];
	  if ($request_type == 'NONSSL') {
	    define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
	  } else {
	    define('DIR_WS_CATALOG', DIR_WS_HTTPS_CATALOG);
	  }
	  require $icSysPath . DIR_WS_FUNCTIONS . 'database.php';
	  tep_db_connect() or die('Unable to connect to database server!');
	// get application configuration
	  $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);
	  while ($configuration = tep_db_fetch_array($configuration_query)) {
	    define($configuration['cfgKey'], $configuration['cfgValue']);
	  }
	  
// load classes / functions needed in storeOrder 4 OSC mods
    require(DIR_WS_FUNCTIONS . 'general.php');
    require(DIR_WS_FUNCTIONS . 'html_output.php');
    require(DIR_WS_FUNCTIONS . 'sessions.php');
    require(DIR_WS_CLASSES . 'order_total.php');
    require(DIR_WS_CLASSES . 'email.php');
    require(DIR_WS_CLASSES . 'mime.php');
    require_once DIR_WS_CLASSES . 'shopping_cart.php';
    
    global $currencies;
    require(DIR_WS_CLASSES . 'currencies.php');
	  $currencies = new currencies();

  }
  
  define('IC_SESSION_NAME', 'osCsid');
  
// load wrapper
  require_once dirname(__FILE__) . '/' . basename(__FILE__, '.config.php') . '.php';
?>